﻿<UserControl x:Class="Unscrambler.Controls.LetterTile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:constants="clr-namespace:Unscrambler.Constants"
             mc:Ignorable="d" 
             d:DesignHeight="40" d:DesignWidth="40"
             MaxHeight="{Binding Source={x:Static constants:SizeConstants.LetterTileSideLength}}" MaxWidth="{Binding Source={x:Static constants:SizeConstants.LetterTileSideLength}}"
             MinHeight="{Binding Source={x:Static constants:SizeConstants.LetterTileSideLength}}" MinWidth="{Binding Source={x:Static constants:SizeConstants.LetterTileSideLength}}"
             BorderBrush="Black"
             BorderThickness="1" IsManipulationEnabled="True">
    <DockPanel>
        <DockPanel.Background>
            
            <ImageBrush ImageSource="..\Images\metaltile2.jpg" Stretch="UniformToFill"/>
            
            
        </DockPanel.Background>
        <!--<DockPanel.Effect>
            <DropShadowEffect Color="Black" RenderingBias="Performance"/>
        </DockPanel.Effect>-->
        <TextBlock Text="{Binding Path=Letter}"
                    Name="letterTextBox" 
                   VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black"
                    FontSize="32" FontFamily="Arial" FontWeight="DemiBold">
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="b">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="d">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="n">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="p">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                         <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="s">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                         <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="u">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                         <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="w">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=letterTextBox,Path=Text}" Value="z">
                            <Setter Property="TextDecorations" Value="Underline"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
            
        </TextBlock>
    </DockPanel>
</UserControl>
